﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_travel_insurance_ViewTravelInsurance : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[CE.Global.General.UserId] == null)
        {
            Response.Redirect("~/Admin/AdminSecureLogin.aspx");
        }
        
    }

    protected void grvTADetails_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (grvTADetails.Rows.Count > 0)
        {
            string strTAId = grvTADetails.SelectedDataKey.Value.ToString();
            Response.Redirect("AddNewTravelInsurance.aspx?TAId=" + strTAId + "&Cov=" + grvTADetails.Rows[grvTADetails.SelectedIndex].Cells[3].Text.ToString());
        }
    }

    protected void grvTADetails_RowDataBound(Object src, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.Cells[4].Text == "STD")
                e.Row.Cells[4].Text = "Standard Cover";
            else if (e.Row.Cells[4].Text == "MED")
                e.Row.Cells[4].Text = "Medium Cover";
            else 
                e.Row.Cells[4].Text = "High Cover";

        }
    }


}
